<%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 5/15/2021
  Time: 11:32 PM
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Welcome</title>
</head>
<body>
<h2>Welcome,<%-- todo 4.2.1 use c:out to print username from parammeter --%>
    <c:out value="${username}"/>
    <form>
        <br/> <input type="submit" value="Logout" name="logout">
    </form>
    <c:if test="${! empty param.logout and param.logout eq 'Logout'}">
        ${pageContext.session.invalidate()}
        <c:redirect url="login.jsp"/>
    </c:if>
</h2>

<%--<h1>Session info</h1>--%>
<%--Session ID: ${pageContext.session.id}<br/>--%>
<%--Creation Time: ${pageContext.session.creationTime}<br/>--%>
<%--Last Accessed Time: ${pageContext.session.lastAccessedTime}<br/>--%>
<%--Max Inactive Interval: ${pageContext.session.maxInactiveInterval}<br/>--%>
</body>
</html>
